package com.example.xutildemoproject;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;


import com.example.xutildemoproject.fragment.MainFragment;
import com.xuexiang.xpage.base.XPageActivity;
import com.xuexiang.xutil.app.notify.NotificationUtils;


public class MainActivity extends XPageActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        openPage(MainFragment.class);
        if (!NotificationUtils.isNotifyPermissionOpen(this)) {
            new AlertDialog.Builder(this)
                    .setCancelable(false)
                    .setMessage("通知权限未打开，是否前去设置？")
                    .setPositiveButton("是", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            NotificationUtils.openNotifyPermissionSetting(MainActivity.this);
                        }
                    }).setNegativeButton("否",null)
                    .show();
        }
    }
}
